import com.bulenkov.darcula.DarculaLaf;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;

/**
 * Created by LLAP on 2017/12/5.
 * Copyright (c) 2017 LLAP. All rights reserved.
 */
public class Main extends JFrame{
    public Main() {
        super("Test");
        try {
            UIManager.setLookAndFeel(new DarculaLaf());
        } catch (Exception e) {
            try {
                UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
            }
            catch (Exception ex) {
                try {
                    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                }
                catch (Exception exc) {
                    System.out.println("Substance Raven Graphite failed to initialize");
                }
            }
        }
        this.setSize(400, 150);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        JPanel panel = new JPanel(new GridLayout(1, 4, 15, 0));
        panel.setBorder(new EmptyBorder(10, 10, 10, 10));
        JButton server, client, worker, board;
        server = new JButton("服务端");
        client = new JButton("取号机");
        worker = new JButton("叫号机");
        board = new JButton("告示牌");
        panel.add(server);
        panel.add(client);
        panel.add(worker);
        panel.add(board);
        this.add(panel);
        server.addActionListener(e -> {
            new Server().setVisible(true);
            server.setEnabled(false);
        });
        client.addActionListener(e -> {
            new Client().setVisible(true);
        });
        worker.addActionListener(e -> {
            new Worker().setVisible(true);
        });
        board.addActionListener(e -> {
            new Board().setVisible(true);
        });
    }
    public static void main(String[] args) {
        new Main().setVisible(true);
    }
}
